#! /bin/bash
# This is the basic script for project setup with the GNU autotools.
# Visit:
# http://seth-g-kriticos.blogspot.com/2008/06/how-to-set-up-open-source-c-development.html
# to find out, what it does.

echo "Please enter the project name: "
read NAME
echo "Bootstrapping $NAME project.."

mkdir $NAME
cd $NAME

echo "Creating configure.in.."
echo "AC_INIT" > configure.in
echo "AM_INIT_AUTOMAKE($NAME,0.1.0)" >> configure.in
echo "AC_PROG_CC" >> configure.in
echo "AC_PROG_CXX" >> configure.in
echo "AC_OUTPUT(Makefile)" >> configure.in

echo "Creating mandatory files.."
touch AUTHORS NEWS README ChangeLog ${NAME}.c

echo "Creating Makefile.am.."
echo "bin_PROGRAMS = $NAME" > Makefile.am
echo "${NAME}_SOURCES = ${NAME}.c" >> Makefile.am

echo "Creating the build scripts.."
aclocal
autoconf
automake -a
./configure

